import type { RouteRecordRaw } from "vue-router"


import CommonFooter from "@/components/CommonFooter.vue"

import HomeView from "@/views/Home/index.vue"
import CategoryView from "@/views/Category/index.vue"
import CartView from "@/views/Cart/index.vue"
import MineView from "@/views/Mine/index.vue"

import ListView from "@/views/List/index.vue";
import DetailView from "@/views/Detail/index.vue";
import orderConfirmView from "@/views/Order/orderConfirm.vue"




import logins from "@/views/Logins/routes"
import addressRoutes from "@/views/Address/routes"


let routes: MineRouteRawArray = [{
    path: "/",
    name: "home",
    // component: HomeView,
    components: {
        default: HomeView,
        footer: CommonFooter
    }
}, {
    path: "/category",
    name: "category",
    // component: CategoryView,
    components: {
        default: CategoryView,
        footer: CommonFooter
    }
}, {
    path: "/list",
    name: "list",
    component: ListView,
}, {
    path: "/detail",
    name: "detail",
    meta: { requiredAuth: true },
    component: DetailView,
}, {
    path: "/cart",
    name: "cart",
    meta: { requiredAuth: true },
    component: CartView,
}, {
    path: "/order/confirm",
    name: "order-confirm",
    meta: { requiredAuth: true },
    component: orderConfirmView,
}, {
    path: "/mine",
    name: "mine",
    meta: { requiredAuth: true },
    // component: MineView,
    components: {
        default: MineView,
        footer: CommonFooter
    }
},
...logins,
...addressRoutes,
{
    path: "/404",
    name: "404",
    component: () => import("@/views/NotFound/index.vue"),
}
]



export default routes;